package com.htl.泛型;

public class Time2__test {
    public static void main(String[] args) {
        Time2<String,Integer,Float> time = new Time2<>();
        time.setHour("十点");
        time.setMinute(10);
        time.setSecond(10.0f);
        System.out.println("现在的时间是---> " + time.getHour() + ":" + time.getMinute()
                + ":" + time.getSecond());
    }
}


class Time2<H,M,S> {
    private H hour;
    private M minute;
    private S second;

    public H getHour() {
        return hour;
    }

    public void setHour(H hour) {
        this.hour = hour;
    }

    public M getMinute() {
        return minute;
    }

    public void setMinute(M minute) {
        this.minute = minute;
    }

    public S getSecond() {
        return second;
    }

    public void setSecond(S second) {
        this.second = second;
    }
}
